#include <charconv> 
#include <iostream>
#include <array>

int main()
{
    std::array<char, 10> sa{ "123a321" };
    std::array<char, 10> sb{ "123.45b3" };
    std::array<char, 10> sc{ ".123de" };
    int ia{ -1 }, ib{ -1 }, ic{ -1 };
    auto iaec = std::from_chars(sa.data(), sa.data() + sa.size(), ia);
    auto ibec = std::from_chars(sb.data(), sb.data() + sb.size(), ib);
    auto icec = std::from_chars(sc.data(), sc.data() + sc.size(), ic);
    if (std::errc::invalid_argument == icec.ec)
    {
        std::cout << "error:" << icec.ptr << std::endl;
    }
    std::cout << "ia:" << ia << "\tib:" << ib << "\tic:" << ic << std::endl;
    double da{ -1 }, db{ -1 }, dc{ -1 };

    auto daec = std::from_chars(sa.data(), sa.data() + sa.size(), da);
    auto dbec = std::from_chars(sb.data(), sb.data() + sb.size(), db);
    auto dcec = std::from_chars(sc.data(), sc.data() + sc.size(), dc);

    std::cout << "da:" << da << "\tdb:" << db << "\tdc:" << dc << std::endl;

    return 0;
}